<?php
/* @var $this TeacherController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
    '教学队伍',
    '教学团队',
);

?>
<?php
$this->menuitemName = '成果展示';
$this->menuList = array();
$this->menuList[] = array('label'=>'教学团队', 
    'url'=>'teacher/index'
);
$this->menuList[] = array('label'=>'教学成果', 
    'url'=>'display/teachingachievement'
);
$this->menuList[] = array('label'=>'教学水平', 
    'url'=>'display/view/9/2'
);

?>

    <div style="width:75%;float:left;background:white;">
        <div class="panel panel-box" style="overflow:hidden;">
            <div class="panel-heading">
                <h3 class="panel-title">
                <?php if(yii::app()->user->isGuest == 0 && (yii::app()->user->id == $model->user_id || yii::app()->user->checkAccess('admin'))):?>
                    <span id="updateTeacherBrief" class="pull-right glyphicon glyphicon-pencil"
                        data-toggle="modal" data-target="#teacherBriefModal" style="cursor:pointer"></span>
                <?php endif;?>
                        <?php echo yii::t('other/teacher','Teacher Brief')?>
                </h3>
            </div>
            <div class="panel-body" style="padding:15px">
                 <div class="col-xs-4">
                    <?php if(CHtml::encode($model->brief) == ""):?>
                     <img src="<?php echo Yii::app()->baseUrl.'/images/default_user.png';?>" class="teacher-picture" alt="" />
                    <?php else:?>
                     <img src="<?php echo Yii::app()->baseUrl .'/'.CHtml::encode($model->brief);?>" class="teacher-picture" />
                    <?php endif;?>
                </div>
                <div class="col-xs-8">
                    <table class="table" id="teacher-update">
                    <tbody>
                    <tr>
                        <td><?php echo yii::t('other/teacher','Teacher Name').'：';?><?php echo CHtml::encode($model->teacher_name);?></td>
                    </tr>
                    <tr>
                        <td><?php echo yii::t('other/teacher','Sex').'：';?><?php echo CHtml::encode($model->sex);?></td>
                        <td><?php echo yii::t('other/teacher','Birthday').'：';?><?php echo date('Y-m',strtotime($model->birthday));?></td>
                    </tr>
                    <tr>
                        <td><?php echo yii::t('other/teacher','Nation').'：';?><?php echo CHtml::encode($model->nation);?></td>
                        <td><?php echo yii::t('other/teacher','Technical Position').'：';?><?php echo CHtml::encode($model->technical_position);?></td>
                    </tr>
                    <tr>
                        <td><?php echo yii::t('other/teacher','Degree').'：';?><?php echo CHtml::encode($model->degree);?></td>
                        <td><?php echo yii::t('other/teacher','Graduated').'：';?><?php echo CHtml::encode($model->graduated);?></td>
                    </tr>
                    <tr>
                        <td><?php echo yii::t('other/teacher','Tel').'：';?><?php echo CHtml::encode($model->tel);?></td>
                        <td><?php echo yii::t('other/teacher','Zip Code').'：';?><?php echo CHtml::encode($model->zip_code);?></td>
                    </tr>
                    <tr>
                        <td colspan="2"><?php echo yii::t('other/teacher','Address').'：';?><?php echo CHtml::encode($model->address);?></td>
                    </tr>
                    </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="panel panel-box" style="overflow:hidden;">
            <div class="panel-heading">
                <h3 class="panel-title">
                <?php if(yii::app()->user->isGuest == 0 && (yii::app()->user->id == $model->user_id || yii::app()->user->checkAccess('admin'))):?>
                    <span id="updateTeacherRE" class="pull-right glyphicon glyphicon-pencil"
                        data-toggle="modal" data-target="#teacherREModal" style="cursor:pointer"></span>
                <?php endif;?>

                    <?php echo yii::t('other/teacher','Research Experience')?>
                </h3>
            </div>
            <div class="panel-body" style="padding:15px">
                    <?php echo $model->research_experience;?>
            </div>
        </div>
        <div class="panel panel-box" style="overflow:hidden;">
            <div class="panel-heading">
                <h3 class="panel-title">
                <?php if(yii::app()->user->isGuest == 0 && (yii::app()->user->id == $model->user_id || yii::app()->user->checkAccess('admin'))):?>
                    <span id="updateTeacherRA" class="pull-right glyphicon glyphicon-pencil"
                        data-toggle="modal" data-target="#teacherRAModal" style="cursor:pointer"></span>
                <?php endif;?>

                    <?php echo yii::t('other/teacher','Research Achievement')?>
                </h3>
            </div>
            <div class="panel-body" style="padding:15px">
                    <?php echo $model->research_achievement;?>
            </div>
        </div>
    </div>
    <div style="width:24%;float:right;background:white;">
            <?php
                if(isset($this->menuitemName))
                {
                    $this->widget('MenuList',array(
                        'header'=>$this->menuitemName,
                        'menu'=>$this->menuList,
                    ));
                }
            ?>
 
         <div class="panel panel-box" style="text-overflow:ellipsis;">
            <div class="panel-heading">
                <h3 class="panel-title">
                   <?php echo "教师列表"?>
                </h3>
            </div>
            <ul class="list-group">
                <?php for($i = 0;$i < count($levelModel);$i++):?>
                    <li class="list-group-item well">
                    <?php $teachers = $levelModel[$i]->tblTeachers;$count = 0;?>
                    <table class="table" style="margin-bottom:0px">
                    <tbody>
                    <?php for($j = 0;$j < count($teachers);$j++):?>
                        <?php if(($j % 2) == 0):?>
                        <tr>
                        <?php endif;?>
                        <?php $count++;?>
                        <td class="text-center" style="border-top:0px;">
                        <a href="<?php echo yii::app()->baseUrl."/teacher/".$teachers[$j]->teacher_id;?>"style="border-top:0px;color:black;">
                            <span class="glyphicon glyphicon-user"></span>
                            <?php echo $teachers[$j]->teacher_name;?>
                        </a>
                        </td>
                         <?php if(($count % 2) == 0):?>
                        </tr>
                        <?php $count = 0;endif;?>
                    <?php endfor;?>
                    </tbody>
                    </table>
                    </li>
                <?php endfor;?>
            </ul>
        </div>
    </div>
<!--teacher brief modal -->
<div class="modal fade" id="teacherBriefModal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:50%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel">
            <?php echo yii::t('other/teacher','Teacher Brief')?>
        </h4>
      </div>
      <div class="modal-body">
      <form id="teacherBrief" method="post" action="<?php echo yii::app()->baseUrl.'/teacher/'.$model->teacher_id;?>" enctype="multipart/form-data">
            <div class="col-md-5 col-xs-5 col-sm-5 col-lg-5">
                <p><img src="<?php echo $model->brief;?>" id="imageViewer" width=100% height=300></img></p>
                <input type="file" id="headImageView" name="imageFile" style="width:100%;"accept="image/*" onchange="return headImagePreview()"/>
                <input type="text" id="imageUrl" name="imageUrl" style="display:none" value="<?php echo $model->brief;?>"/>
           </div>
            <div class="col-md-7 col-xs-7 col-sm-7 col-lg-7">
                <table class="table" id="teacher-update">
                    <tbody>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Teacher Name');?>: </label></>
                            <td><input type="text" name="teacher_name" class="form-control info" value="<?php echo CHtml::encode($model->teacher_name);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Sex');?>: </label></>
                            <td>
                                <input type="radio" name="sex" value="<?php echo yii::t('other/teacher','Male');?>" checked="checked"><?php echo yii::t('other/teacher','Male');?>&nbsp&nbsp
                                <input type="radio" name="sex" value="<?php echo yii::t('other/teacher','Female');?>"><?php echo yii::t('other/teacher','Female');?>
                            </td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Birthday');?>: </label></>
                            <td><input type="text" name="birthday" class="form-control info" value="<?php echo date('Y-m-d',strtotime(CHtml::encode($model->birthday)));?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Nation');?>: </label></>
                            <td><input type="text" name="nation" class="form-control info" value="<?php echo CHtml::encode($model->nation);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Technical Position');?>: </label></>
                            <td><input type="text" name="technical_position" class="form-control info" value="<?php echo CHtml::encode($model->technical_position);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Degree');?>: </label></>
                            <td><input type="text" name="degree" class="form-control info" value="<?php echo CHtml::encode($model->degree);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Graduated');?>: </label></>
                            <td><input type="text" name="graduated" class="form-control info" value="<?php echo CHtml::encode($model->graduated);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Address');?>: </label></>
                            <td><input type="text" name="address" class="form-control info" value="<?php echo CHtml::encode($model->address);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Zip Code');?>: </label></>
                            <td><input type="text" name="zip_code" class="form-control info" value="<?php echo CHtml::encode($model->zip_code);?>"></input></td>
                        </tr>
                        <tr>
                            <td><label><?php echo yii::t('other/teacher','Tel');?>: </label></>
                            <td><input type="text" name="tel" class="form-control info" value="<?php echo CHtml::encode($model->tel);?>"></input></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="text-right">
                <button type="submit" class="btn btn-primary" name="teacherBrief">
                    <?php echo yii::t('other/Site','Save');?>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    <?php echo yii::t('other/Site','Close');?>
                </button>
            </div>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--Teacher RE modal -->
<div class="modal fade" id="teacherREModal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:70%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel">
            <?php echo yii::t('other/teacher','Research Experience')?>
        </h4>
      </div>
      <div class="modal-body">
        <form method="post" action="">
            <div class="form-group">
                <textarea id="inputCourseBrief" name="teacherRE">
                    <?php echo $model->research_experience;?>
                </textarea>
     	    <script type="text/javascript">
            var editor = new UE.ui.Editor({
                toolbars:[
                    ['source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                    'directionalityltr', 'directionalityrtl', 'indent', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                    'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                    'insertimage', 'emotion', 'scrawl', 'insertvideo', 'insertcode','template', 'background', '|',
                    'horizontal', 'date', 'time', 'spechars','wordimage', '|',
                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|',
                    'print', 'preview', 'searchreplace', 'help']
                ]
            });
			    editor.render("inputCourseBrief");
            </script>
            </div>
            <div class="text-right">
                <button type="submit" class="btn btn-primary">
                    <?php echo yii::t('other/Site','Save');?>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    <?php echo yii::t('other/Site','Close');?>
                </button>
            </div>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!--teacher RA modal -->
<div class="modal fade" id="teacherRAModal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">
  <div class="modal-dialog" style="width:70%;margin-top:4%">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="mymodallabel">
            <?php echo yii::t('other/teacher','Research Achievement')?>
        </h4>
      </div>
      <div class="modal-body">
        <form method="post" action="">
            <div class="form-group">
                <textarea id="inputCourseContent" name="teacherRA">
                    <?php echo $model->research_achievement;?>
                </textarea>
     	    <script type="text/javascript">
            var editor = new UE.ui.Editor({
                toolbars:[
                    ['source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                    'directionalityltr', 'directionalityrtl', 'indent', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                    'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                    'insertimage', 'emotion', 'scrawl', 'insertvideo', 'insertcode','template', 'background', '|',
                    'horizontal', 'date', 'time', 'spechars','wordimage', '|',
                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|',
                    'print', 'preview', 'searchreplace', 'help']
                ]
            });
			    editor.render("inputCourseContent");
            </script>
            </div>
            <div class="text-right">
                <button type="submit" class="btn btn-primary">
                    <?php echo yii::t('other/Site','Save');?>
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal">
                    <?php echo yii::t('other/Site','Close');?>
                </button>
            </div>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


